from flask_restplus import Api
from .user import api as user_ns
from .book import api as book_ns
from .auth import api as auth_ns

DEFAULT_NAMESPACES = (
    (user_ns,"/users"),
    (book_ns,"/books"),
    (auth_ns,"/auth"),
)


#配置资源
def config_resource(app):
    api = Api(app, version='0.1',title='书籍共享网站',description="描述")
    for namespace,path in DEFAULT_NAMESPACES:
        api.add_namespace(namespace,path)